<#noparse><#--</#noparse>${objectNameCn}管理<#noparse>--></#noparse>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>${objectNameCn}管理</title>
<#noparse>
<#include "/share/include.ftl" />
<#import "/share/toolbar_common.ftl" as tolbcom/>
</#noparse>
<#noparse><#assign name_space='</#noparse>${abbObjectName}<#noparse>'></#noparse>
<script type="text/javascript" language="javascript" src="${"$"+"{"}${projectName}${"}"}/resources/js/common/common.js"></script>
<script type="text/javascript" language="javascript" src="${"$"+"{"}${projectName}${"}"}/resources/js/${model}/${abbObjectName}.js"></script>
<script>
	var _jsSessionId='<#noparse>${sessionId!''}</#noparse>'; //sessionId
	/**
	 * 初始化操作按钮
	 * @param value
	 * @param row
	 * @param index
	 * @returns {String}
	 */
	function optsFormatter(value, row, index) {
		var returnMsg="";
		<#--权限控制  0：不控制  1：添加 2：修改 3：删除 4：查询 5：打印 6：导出-->
		var id = row.id;
		var show=<#noparse><#if checkPrivileges(sessionId,</#noparse>${'systemSn'}<#noparse>,name_space,1) == true>'<a href="javascript:void(0)" class="easyui-linkbutton" style="color: blue;" iconCls="icon-aduit" plain="true" onclick="</#noparse>${abbObjectName}<#noparse>.showUI(\''
			+ id + '\')">查看</a>&nbsp;&nbsp;'<#else>''</#if>;</#noparse>
		var update=<#noparse><#if checkPrivileges(sessionId,</#noparse>${'systemSn'}<#noparse>,name_space,2) == true>'<a href="javascript:void(0)" class="easyui-linkbutton" style="color: blue;" iconCls="icon-del" plain="true" onclick="</#noparse>${abbObjectName}<#noparse>.updateUI(\''
			+ id + '\')">修改</a>&nbsp;&nbsp;'<#else>''</#if>;</#noparse>
		var del =<#noparse><#if checkPrivileges(sessionId,</#noparse>${'systemSn'}<#noparse>,name_space,3) == true>'<a href="javascript:void(0)" class="easyui-linkbutton" style="color: blue;" iconCls="icon-del" plain="true" onclick="</#noparse>${abbObjectName}<#noparse>.del(\''
			+ id + '\')">删除</a>&nbsp;&nbsp;'<#else>''</#if>;</#noparse>
		<#assign statusFlag=false>
		<#assign delFlagFlag=false>
		<#if columnFieldList??>
		  <#list columnFieldList as item>
			<#if item.field??>
				<#if 'status'=item.field>
					<#assign statusFlag=true>
				</#if>
				<#if 'delFlag'=item.field>
					<#assign delFlagFlag=true>
				</#if>
			</#if>
		  </#list>
		</#if>
		
		<#if statusFlag>
		var statushtml="";
		var status=row.status;
		if (status == 0) {
			status=1;
			statushtml = <#noparse><#if checkPrivileges(sessionId,</#noparse>${'systemSn'}<#noparse>,name_space,2) == true>'<a href="javascript:void(0)" class="easyui-linkbutton" style="color: blue;" iconCls="icon-del" plain="true" onclick="</#noparse>${abbObjectName}<#noparse>.updateStatus('
					+ status + ',\'' + id + '\')">启用</a>&nbsp;&nbsp;'<#else>''</#if>;</#noparse>
		} else {
			status=0;
			statushtml = <#noparse><#if checkPrivileges(sessionId,</#noparse>${'systemSn'}<#noparse>,name_space,2) == true>'<a href="javascript:void(0)" class="easyui-linkbutton" style="color: blue;" iconCls="icon-del" plain="true" onclick="</#noparse>${abbObjectName}<#noparse>.updateStatus('
					+ status + ',\'' + id + '\')">禁用</a>&nbsp;&nbsp;'<#else>''</#if>;</#noparse>
		}
		returnMsg = show + statushtml +  update + del;
		<#else>
		returnMsg = show + update + del;
		</#if>
		
		<#if delFlagFlag>
		var delFlag = row.delFlag;
		if(delFlag==0){
			returnMsg="";
		}
		</#if>
		return returnMsg;
	}
</script>
</head>
<body class="easyui-layout">
	
	<div data-options="region:'north',border:false">
		<div id="toolbar" class="easyui-toolbar">
			<#noparse><#--重置,刷新-->
			<@tolbcom.refset sessionId,</#noparse>${'systemSn'}<#noparse>,name_space,1,'common','searchForm','subDg','datagrid'/>
			</#noparse>
		<#if statusFlag>
			<#noparse>
			<#if checkPrivileges(sessionId,</#noparse>${'systemSn'}<#noparse>,name_space,2) == true>
			<a href="javascript:void(0)"  iconCls="icon-start" plain="true" onclick="</#noparse>${abbObjectName}<#noparse>.updateStatus(1)">启用</a>
			<a>-</a>
			</#if>
			<#if checkPrivileges(sessionId,</#noparse>${'systemSn'}<#noparse>,name_space,2) == true>
			<a href="javascript:void(0)"  iconCls="icon-stop" plain="true" onclick="</#noparse>${abbObjectName}<#noparse>.updateStatus(0)">禁用</a>
			<a>-</a>
			</#if>
			</#noparse>
		</#if>
			<#noparse>
			<#if checkPrivileges(sessionId,</#noparse>${'systemSn'}<#noparse>,name_space,0) == true>
			<a href="javascript:void(0)"  iconCls="icon-add" plain="true" onclick="</#noparse>${abbObjectName}<#noparse>.addUI()">添加</a>
			<a>-</a>
			</#if>
			<#if checkPrivileges(sessionId,</#noparse>${'systemSn'}<#noparse>,name_space,2) == true>
			<a href="javascript:void(0)"  iconCls="icon-edit" plain="true" onclick="</#noparse>${abbObjectName}<#noparse>.updateUI()">修改</a>
			<a>-</a>
			</#if>
			<#if checkPrivileges(sessionId,</#noparse>${'systemSn'}<#noparse>,name_space,3) == true>
			<a href="javascript:void(0)"  iconCls="icon-del" plain="true" onclick="</#noparse>${abbObjectName}<#noparse>.del()">删除</a>
			<a>-</a>
			</#if>
		</div>
		<#if checkPrivileges(sessionId,</#noparse>${'systemSn'}<#noparse>,name_space,1) == true>
		<!--搜索start
		<div class="search-div">
			<form name="searchForm" id="searchForm" action="" method="post" onsubmit="return false;">
				<table class="search-tb">
					<col width="80" />
					<col />
					<col width="80" />
					<col />
					<col width="80" />
					<col />
					<tbody>
						<tr>
							<th>名称 ：</th>
							<td>
								<input class="ipt jsClearValue" name="name" style="width: 150px;" autocomplete="off"/>
							</td>
							<th>状态：</th>
							<td>
								<select id="cc" class="easyui-combobox" name="status" style="width: 100px;">
										<option value="">全部</option>
										<option value="1">启用</option>
										<option value="0">禁用</option>
								</select>
							</td>
							<th>时间：</th>
							<td><input class="ipt easyui-datebox w80 jsClearValue" name="startTime" style="width: 140px;" data-options="required:false,missingMessage:'时间不能为空！',dateFmt:'yyyy-MM-dd HH:mm:ss'" autocomplete="off"/> 到 
								<input class="ipt easyui-datebox w80 jsClearValue" name="endTime" style="width: 140px;" data-options="required:false,missingMessage:'时间不能为空！',dateFmt:'yyyy-MM-dd HH:mm:ss'" autocomplete="off"/>
							</td>
							<th>删除状态：</th>
							<td>
								<select id="cc" class="easyui-combobox" name="delFlag" style="width: 100px;">
										<option value="">全部</option>
										<option value="1" selected>未删除</option>
										<option value="0">已删除</option>
								</select> 
								<a iconCls="icon-search" class="easyui-linkbutton ml10" id="SearchBtn" data-options="iconCls:'icon-search'">查询</a>
							</td>
						</tr>
					</tbody>
				</table>
			</form>
		</div>
		-->
		<!--搜索end-->
		</#if>
		</#noparse>
	</div>
	<!--列表start-->
	<div data-options="region:'center',border:false">
		<table id="subDg" class="easyui-datagrid" title="" style="width:700px;height:250px"
			data-options="collapsible : true,rownumbers:true,pagination : true,pageSize : 20,pageList : [ 20, 50,100 ],
							url :'${"$"+"{"}${projectName}${"}"}/${projectName}/${model}/${abbObjectName}/ajaxList.do?sessionId=<#noparse>${sessionId!''}</#noparse>', method : 'post',singleSelect : false">
			<thead>
				<tr>
					<th data-options="field:'id',checkbox:true"></th>
					<th data-options="field:'opt',width : 150,align:'left',formatter : optsFormatter">操作</th>
			<#if columnFieldList??>
			<#list columnFieldList as item>
				<#if item.field?? && 'id'!=item.field>
					<th data-options="field:'${item.field}',width : 150,align:'left'<#if 'type'==item.field || 'status'==item.field || 'delFlag'==item.field>,formatter : ${abbObjectName}.${item.field}Formatter,styler : ${abbObjectName}.${item.field}Styler</#if>">${(item.comment)!''}</th>
				</#if>
			</#list>
			</#if>
				</tr>
			</thead>
		</table> 
	</div>
	<!--列表end-->
</body>
</html>
